package com.crm.mongo.task;

import java.util.List;

import org.quartz.JobExecutionContext;
import org.springframework.scheduling.quartz.QuartzJobBean;

import com.crm.model.entity.CountWorkBench;
import com.crm.mongo.service.MongoMinService;

public class CountWorkTask extends QuartzJobBean{
	
	public void count(CountWorkBench record){
		MongoMinService service = (MongoMinService) ApplicationContextUtil.getBean("mongoMinService");
		List<CountWorkBench> list = service.task(record);
		service.saveBatch(list);
	}

	@Override
	protected void executeInternal(JobExecutionContext context){
		this.count(new CountWorkBench());
	}
}
